package com.shanghai.shanghaielectric.DataAdapter;

import android.util.Log;

import com.shanghai.shanghaielectric.Model.WriteDataModel;

import shanghaielectric_lib.RDBHelper.RDBHelper;
import shanghaielectric_lib.Utils.LogUtil;

/**
 * Created by 45000460 on 2017/11/27.
 */

public class WriteData2CellsAdapter {
    public void writeDataToCells(WriteDataModel writeDataModel) {
        int deviceID = 1;
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 89, writeDataModel.controlCommand.getValue());
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 90, writeDataModel.unitEnable + "");

        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 91, writeDataModel.totalCapacity + "");

        LogUtil.e("totalCapacity-adapter",""+writeDataModel.totalCapacity);
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 92, writeDataModel.cleareSwitchTimes + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 93, writeDataModel.testCapacitor1 + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 94, writeDataModel.testCapacitor2 + "");
//        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 95, writeDataModel.deviceModel + "");
//        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 96, writeDataModel.deviceModel + "");
//        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 97, writeDataModel.deviceModel + "");
//        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 98, writeDataModel.deviceModel + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 99, writeDataModel.deviceModel + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 100, writeDataModel.ctSystemOrLoad + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 101, writeDataModel.ctSystemOrLoadProperty + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 102, writeDataModel.ctCabinet + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 103, writeDataModel.highHarmonicSelect1 + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 104, writeDataModel.highHarmonicSelect2 + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 105, writeDataModel.powerFactorSet + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 106, writeDataModel.qPercentSet + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 107, writeDataModel.thdLimitU + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 108, writeDataModel.thdLimitI + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 109, writeDataModel.phaseOffset1 + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 110, writeDataModel.phaseOffset3 + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 111, writeDataModel.phaseOffset5 + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 112, writeDataModel.phaseOffset7 + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 113, writeDataModel.phaseOffset9 + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 114, writeDataModel.phaseOffset11 + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 115, writeDataModel.phaseOffset13 + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 116, writeDataModel.phaseOffset15 + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 117, writeDataModel.phaseOffset17 + "");

//        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 118, writeDataModel.deviceModel + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 119, writeDataModel.amPercent1 + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 120, writeDataModel.amPercent3 + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 121, writeDataModel.amPercent5 + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 122, writeDataModel.amPercent7 + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 123, writeDataModel.amPercent9 + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 124, writeDataModel.amPercent11 + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 125, writeDataModel.amPercent13 + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 126, writeDataModel.amPercent15 + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 127, writeDataModel.amPercent17 + "");

//        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 128, writeDataModel.deviceModel + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 129, writeDataModel.urmsMax + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 130, writeDataModel.urmsMin + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 131, writeDataModel.irmsMax + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 132, writeDataModel.deviceType + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 133, writeDataModel.capacitorSwitchDelay + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 134, writeDataModel.hysteresysBanWidth + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 135, writeDataModel.passiveCapacitorGroup + "");
        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 136, writeDataModel.switchInterval + "");
//        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 137, writeDataModel.deviceModel + "");
//        RDBHelper.getInstance().putPointValue_writeValue(deviceID, 138, writeDataModel.deviceModel + "");

    }


}
